<?php
/**
 * 标签管理
 */
class TagController extends AdminBase{
	public function actionIndex(){
		$this->baseIndex('TagModel');
	}
	public function actionCreate(){
		$this->baseCreate('TagModel');
	}
	public function actionUpdate(){
		$this->baseUpdate('TagModel');
	}
	public function actionDelete(){
		$this->baseDelete('TagModel');
	}
	public function actionShowGoods($id){
		$_GET['TagGoodsModel']['TagID'] = $id;
		$this->baseIndex('TagGoodsModel', array('with' => 'GoodsModel'));		
	}
	/**
	 * 删除标签商品
	 * @return [type] [description]
	 */
	public function actionDeleteGoods($id){
		$m = TagGoodsModel::model()->findByPk($id);
		$tid = $m->TagID;
		$this->baseDelete('TagGoodsModel','/admin/tag/showGoods/id/'.$tid);
	}
}